package com.fengpb.friday.conductor.core.execution.tasks;

import com.fengpb.friday.conductor.common.metadata.run.Workflow;
import com.fengpb.friday.conductor.common.metadata.task.Task;
import com.fengpb.friday.conductor.core.execution.WorkflowExecutor;

import java.util.HashMap;
import java.util.Map;

public class WorkflowSystemTask {

    private static final Map<String, WorkflowSystemTask> registry = new HashMap<>();

    private String name;

    public WorkflowSystemTask(String name) {
        this.name = name;
        registry.put(name, this);
    }

    public void execute(Workflow workflow, Task task, WorkflowExecutor executor) {
    }

    public boolean isAsync(Task task) {
        return false;
    }

    public static WorkflowSystemTask get(String type) {
        return registry.get(type);
    }
}
